import { ref } from 'vue'
import { defineStore } from 'pinia'
import { getCategoryHeadService } from '@/apis/layout'
export const useCategoryStore = defineStore(
  'rabbit-category',
  () => {
    const categoryList = ref([])

    const getCategoryList = async () => {
      const res = await getCategoryHeadService()
      categoryList.value = res.data.result
    }

    return {
      categoryList,
      getCategoryList
    }
  },
  {
    persist: true
  }
)
